<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:c="http://java.sun.com/jsp/jstl/core"
      xmlns:f="http://java.sun.com/jsf/core">
    <link type="text/css" rel="stylesheet" href="../style.css" />
    <link type="text/css" rel="stylesheet" href="style.css" />
    <h:head>
        <title>New Claim Damage Application</title>
    </h:head>
    <h:body styleClass="form">
        <h:form>
            <p><br></br></p>
            <p><br></br></p>
            <c:choose>
                <c:when test="#{carDamageClaim.exception.cause != null}">
                    <h:outputText value="#{carDamageClaim.exception.cause.message}"/>
                </c:when>
                <c:otherwise>
                    <h:outputText value="#{carDamageClaim.exception.message}"/>
                </c:otherwise>
            </c:choose>
            <h:panelGrid columns="2" id="register" border="1">
                <f:facet name="header">
                    <h:outputText value="Claim Details"/>
                </f:facet>
                <h:outputLabel for="carRegNo" value="Car Registration Number:" />
                <h:inputText id="carRegNo" value="#{carDamageClaim.carRegNo}" />
                <h:outputLabel for="carValue" value="Car Value:" />
                <h:inputText id="carValue" value="#{carDamageClaim.carValue}" />
                <h:outputLabel for="carModel" value="Car Model:" />
                <h:inputText id="carModel" value="#{carDamageClaim.carModel}" />
                <h:outputLabel for="carYear" value="Car Year:" />
                <h:inputText id="carYear" value="#{carDamageClaim.carYear}" />
                <h:outputLabel for="damage" value="Damage Cost:" />
                <h:inputText id="damage" value="#{carDamageClaim.damageCost}" />
                <f:facet name="footer">
                    <h:panelGroup style="display:block; text-align:center">
                        <h:commandButton id="submit" value="Submit claim" action="#{carDamageClaim.submitClaim()}">
                            <f:setPropertyActionListener target="#{carDamageClaim.owner}" value="#{login.userName}"/>
                        </h:commandButton>
                    </h:panelGroup>
                </f:facet>
            </h:panelGrid>
            <h:link value="back" outcome="index"/>
        </h:form>
    </h:body>
</html>

